﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DIProject.Data
{
    public class ShiftOut:DataBase
    {
        private ShiftOut()
        { }
        
        public static void ShiftOutDelete(Int32 original_ID, DateTime original_MD)
        {
            string QueryString = "dbo.ShiftOutDocDelete";
            using (SqlConnection connection = Connection)
            {
                try
                {
                    SqlCommand command = new SqlCommand(QueryString, connection);
                    command.Parameters.AddWithValue("@Original_Id", original_ID);
                    command.Parameters.AddWithValue("@Original_MD", original_MD);
                    command.CommandType = CommandType.StoredProcedure;
                    connection.Open();
                    command.ExecuteNonQuery();
                }
                catch (SqlException se)
                {
                    string s = se.ToString();
                    throw new Util.DIException("Невозможно удалить документ", se);
                }
                catch (Exception ee)
                {
                    string s = ee.ToString();
                    throw new Util.DIException("Невозможно удалить документ", ee);
                }
            }

        }

    }
   
}
